<!DOCTYPE html>
<html>

<head>
  <title>
    <%= title %>
  </title>
  <link rel='stylesheet' href='/stylesheets/style.css' />
  <script>
    var request = new XMLHttpRequest();
    request.open('GET', '/apis/', true);

    request.onload = function () {
      if (request.status >= 200 && request.status < 400) {
        // Success!
        var data = request.responseText;
        document.getElementById('root').innerText = data;
      } else {
        throw new Error('request /apis error');
      }
    };

    request.onerror = function () {
      throw new Error('connect to /apis error');
    };

    request.send();
  </script>
</head>

<body>
  <div id="root"></div>

</body>

</html>